import request from '@/router/axios';
// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/repair/task/minor/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
// 接单
export const receive = (id) => {
  return request({
    url: '/api/hg-equipment/repair/task/receive',
    method: 'get',
    params: {
      id
    }
  })
}

// 详情
export const detail = (id) => {
  return request({
    url: '/api/hg-equipment/repair/task/minor/info',
    method: 'get',
    params: {
      id
    }
  })
}

// 备件列表
export const getSpare = (oriEptCode) => {
  return request({
    url: '/api/hg-public/relation/getSpare',
    method: 'get',
    params: {
      oriEptCode
    }
  })
}

// 物料列表
export const getMaterial = () => {
  return request({
    url: '/api/hg-public/relation/getMaterial',
    method: 'get',
    params: {

    }
  })
}

// 保存计划
export const savePlan = (data, ids) => {
  return request({
    url: '/api/hg-equipment/repair/plan/save',
    method: 'post',
    data: data,
    params: {
      ids
    }
  })
}

// 保存结果
export const saveResult = (data, ids) => {
  return request({
    url: '/api/hg-equipment/repair/result/save',
    method: 'post',
    data: data,
    params: {
      ids
    }
  })
}

// 获取验收
export const getAccept = (taskId) => {
  return request({
    url: '/api/hg-equipment/repair/task/accept/select',
    method: 'get',
    params: {
      taskId
    }
  })
}
